﻿using System.ComponentModel;
using System.Windows.Forms;

namespace Marmat.Forms
{
    public class RequiredComponentStyleEventArgs : CancelEventArgs
    {
        internal Control _control;

        public RequiredComponentStyleEventArgs(Control control, bool enabled)
        {
            this._control = control;
            this.Enabled = enabled;
        }

        /// <summary>
    /// 返回触发验证的控件。
    /// </summary>
    /// <returns></returns>
        public Control Control
        {
            get
            {
                return this._control;
            }
        }

        /// <summary>
    /// 获取目前必填样式是开启还是关闭
    /// </summary>
    /// <returns>如果是开启的话，返回true，反之返回 false。</returns>
        public bool Enabled { get; private set; }
    }
}